﻿@model SCMS.UI.Models.TAORequest
@{AjaxOptions ajaxOpts = new AjaxOptions
      {
          UpdateTargetId = "TADetailsDiv",
          LoadingElementId = "loading",
          HttpMethod = "Post",
          Url = Url.Action("LoadTADetailz"),
          OnSuccess = "disableTAForm(1)"
      };}
<script src="@Url.Content("~/Scripts/js/jquery-1.7.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<div class="partialViewCard">
    <div class="partialViewCardHeader"><h3>New Tender Analysis</h3></div>
    @using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form" }))
    {
        @Html.ValidationSummary(true)
        <table width="98%" align="center" style="margin-left: auto; margin-right: auto;">
            <tr>
                <th>
                    Tender Analysis No
                </th>
                <th>
                    Date
                </th>
                <th>
                    Order Request No
                </th>
            </tr>
            <tr>
                <td>
                    @*@Html.EditorFor(m => m.EntityTenderAnalysis.RefNumber)*@
                    @Html.TextBoxFor(m => m.EntityTenderAnalysis.RefNumber, new { @readonly = "readonly", @id = "taNo" })
                    @Html.HiddenFor(m => m.EntityTenderAnalysis.Id)
                </td>
                <td>
                    @Html.EditorFor(m => m.TADate, new { @id = "taDate" })
                    @Html.ValidationMessageFor(m => m.TADate)
                </td>
                <td>
                    @Html.DropDownListFor(x => x.OrderRequestID, Model.OrderRequests, new { @id = "taORList" })
                    @Html.ValidationMessageFor(x => x.OrderRequestID)
                </td>
            </tr>
            <tr>
                <td>
                    <input type="submit" class="btn green"  value="Proceed" id="taGenBtn" />
                </td>
                <td>
                    <div id="editLink" style="display:none">
                        <a href="#" onclick="disableTAForm(0)">Edit TA Details</a>
                    </div>
                    @if (Model.EditMode)
                    {
                        int supplierAdded = Model.SupplierAdded ? 1 : 0;
                        <input type="hidden" id="supplierAdded" name="supplierAdded" value="@supplierAdded" />
                        <input type="hidden" id="taId" name="taId" value="@Model.EntityTenderAnalysis.Id" />
                    }
                </td>
            </tr>
        </table>
    }
</div>

